﻿using FoodModel;
using J.FoodManageGet.Application.Command.DishesCommand;
using J.FoodRepository.InterFace;
using MediatR;

namespace J.FoodManageGet.Application.CommandHandler.DishesCommandHandler
{
    public class DishesCommandHandler : IRequestHandler<DishesCommand, List<DishesModel>>
    {
        private readonly IDishesReposittory _dishesReposittory;

        public DishesCommandHandler(IDishesReposittory dishesReposittory)
        {
            _dishesReposittory = dishesReposittory;
        }
        public async Task<List<DishesModel>> Handle(DishesCommand request, CancellationToken cancellationToken)
        {
            return await _dishesReposittory.DishesShow(request.DishId);
        }
    }
}
